package com.pray.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.List;

/**
 * Article
 *
 * @author 春江花朝秋月夜
 * @since 2024/1/13 20:39
 */
@Document(indexName = "blog")
@Data
public class Article {
    @Id
    private String id;
    private String title;
    @Field(type = FieldType.Nested,includeInParent = true)
    private List<Author> authors;
    public Article(String title) {
        this.title = title;
    }
}

